<%--
  Created by IntelliJ IDEA.
  User: Cat God 007
  Date: 2024/9/21
  Time: 10:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>brand</title>
</head>
<body>
<h1>hello,${user.username},登录成功</h1>
<div>
    <button id="add_brand">新增品牌</button>
    <hr>
    <div id="brands"></div>
    <table border="1" cellspacing="0" width="80%" >
        <!--表头行-->
        <tr>
            <th>序号</th>
            <th>品牌名称</th>
            <th>企业名称</th>
            <th>排序</th>
            <th>品牌介绍</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        <!-- 表中每行数据-->
        <c:forEach items="${brands}" var="brand" varStatus="bs">
            <tr align="center">
<%--                <td>${brand.id}</td>--%>
               <td>${bs.count}</td>
                <td>${brand.brandname}</td>
                <td>${brand.companyname}</td>
                <td>${brand.ordered}</td>
                <td>${brand.description}</td>

                <c:if test="${brand.status == 1}">
                    <td>启用</td>
                </c:if>
                <c:if test="${brand.status != 1}">
                    <td>禁用</td>
                </c:if>

                <td>
                    <a href="/Login_Web_exploded/updateBrandServlet1?id=${brand.id}">修改</a>
                    <a href="/Login_Web_exploded/deleteBrandServlet?id=${brand.id}">删除</a>
                </td>
            </tr>
        </c:forEach>

    </table>
</div>
<script src="js/axios-0.18.0.js"></script>
<script>
    document.getElementById("add_brand").onclick = function (){
        location.href = "/Login_Web_exploded/addBrand.jsp";
    }
</script>
</body>
</html>
